package com.gzh.teaching.model.vo;

import com.gzh.core.util.NumericHelper;
import com.gzh.teaching.service.dto.GetWorkInfo;
import com.gzh.teaching.service.dto.SaveWorkAnswerIn;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @Author guanzh
 * @Date 2022/2/10 16:13
 * @Description
 */
@Setter
@Getter
@ToString
public class SaveWorkAnswerParam {
    private List<GetWorkInfo> list;

    private String workId;

    private String type;

    public SaveWorkAnswerIn paramToIn(Integer userId) {
        SaveWorkAnswerIn in = new SaveWorkAnswerIn();
        in.setList(this.list);
        in.setWorkId(NumericHelper.toInteger(this.workId));
        in.setType(NumericHelper.toInteger(this.type));
        in.setUserId(userId);
        return in;
    }
}
